<?php

/**
* DirectionsTest.php
*
* Test Directions class
*
* @author     Blazej Zieba <b@zieba.info>
* @copyright  2007 konekto.com
* @version    CVS: $Id:$
*/
require_once '../framework/config.php';
require_once 'simpletest/autorun.php';
require_once '../Directions.class.php';


class  DirectionsTest extends UnitTestCase
{

    var $directions = null ;

    public function setUp() 
    {
        $this->directions = new Directions('wrocław,swietego antoniego 8','wrocław,Pawla Wlodkowica 7','pl');
    }

    public function testPolyLine()
    {
        
        $this->assertTrue( $this->directions->getEncPolyline() == "kf}vHil|fBJs@Ik@MIg@ChAk@v@u@R_@rD`GaBvF" );
    }

    public function testDistance()
    {
        $this->assertTrue( $this->directions->getDistance() == "0,4 km", "Distance is ".$this->directions->getDistance()  );
    }

    public function testHtmlInstructions()
    {
        $instructions = $this->directions->getHtmlInstructions();
        $this->assertTrue(count($instructions) == 4,"Num of instructions is ".count($instructions));
    }
    

    public function tearDown() 
    {
        $this->directions = null;
    }
 

}
?>
